@echo off
setlocal enabledelayedexpansion
chcp 65001 >nul

echo =========================================
echo    GMCM 2025 运行剩余算例
echo =========================================
echo.

REM 确保可执行文件存在
if not exist "competition_scheduler.exe" (
    echo 错误: 找不到 competition_scheduler.exe
    echo 请先运行编译
    pause
    exit /b 1
)

REM 创建汇总报告
set "summary_file=result-all\batch_summary.txt"
echo === GMCM 2025 批量运行报告 === > %summary_file%
echo 运行时间: %date% %time% >> %summary_file%
echo. >> %summary_file%

echo 开始运行剩余算例...
echo.

REM 运行 FlashAttention_Case0
echo [1/3] FlashAttention_Case0
if not exist "result-all\FlashAttention_Case0" mkdir "result-all\FlashAttention_Case0"
.\competition_scheduler.exe "data\CSV-version\FlashAttention_Case0_Nodes.csv" "data\CSV-version\FlashAttention_Case0_Edges.csv" "FlashAttention_Case0" "result-all\FlashAttention_Case0"
if %ERRORLEVEL% equ 0 (
    echo ✅ FlashAttention_Case0 完成
    echo FlashAttention_Case0: 成功 >> %summary_file%
) else (
    echo ❌ FlashAttention_Case0 失败
    echo FlashAttention_Case0: 失败 >> %summary_file%
)
echo.

REM 运行 FlashAttention_Case1  
echo [2/3] FlashAttention_Case1
if not exist "result-all\FlashAttention_Case1" mkdir "result-all\FlashAttention_Case1"
.\competition_scheduler.exe "data\CSV-version\FlashAttention_Case1_Nodes.csv" "data\CSV-version\FlashAttention_Case1_Edges.csv" "FlashAttention_Case1" "result-all\FlashAttention_Case1"
if %ERRORLEVEL% equ 0 (
    echo ✅ FlashAttention_Case1 完成
    echo FlashAttention_Case1: 成功 >> %summary_file%
) else (
    echo ❌ FlashAttention_Case1 失败
    echo FlashAttention_Case1: 失败 >> %summary_file%
)
echo.

REM 运行 Matmul_Case0
echo [3/3] Matmul_Case0
if not exist "result-all\Matmul_Case0" mkdir "result-all\Matmul_Case0"
.\competition_scheduler.exe "data\CSV-version\Matmul_Case0_Nodes.csv" "data\CSV-version\Matmul_Case0_Edges.csv" "Matmul_Case0" "result-all\Matmul_Case0"
if %ERRORLEVEL% equ 0 (
    echo ✅ Matmul_Case0 完成
    echo Matmul_Case0: 成功 >> %summary_file%
) else (
    echo ❌ Matmul_Case0 失败
    echo Matmul_Case0: 失败 >> %summary_file%
)
echo.

echo =========================================
echo 批量运行完成！
echo =========================================
echo.

echo 结果汇总:
type %summary_file%
echo.

echo 检查 result-all\ 目录查看详细结果
pause









